import React, { useEffect } from 'react'
import { Result } from 'antd-mobile'
import { Sticky,NavBar,Button} from 'react-vant'
import {ArrowLeft} from '@react-vant/icons'
import { useNavigate } from 'react-router-dom'
import axios from 'axios'
export default function Resultss() {
    const navigate = useNavigate()
    const [Id,setId] = React.useState()
    useEffect(() => {
        setId(localStorage.getItem('orderPrice'))
    },[])

    //返回
    let navHome = (a) => {
        navigate(a)   //预留
    }
    return (
        <div>
            <Sticky>
            <NavBar
                    title="支付成功"
                    leftText={<ArrowLeft />}
                    onClickLeft={() => navigate('/')}  //预留
                />
            </Sticky>
            <Result
                status='success'
                title='订单支付成功'
                description={'订单金额:￥'+Id}
            />

            <Button type='danger' block style={{ width: '90%',margin:'0 auto',marginBottom:'10px' }} onClick={() => {navHome('/') }}>查看订单</Button>
             <Button type='danger' block style={{ width: '90%',margin:'0 auto',background:'none',color:'#F3453A' }} onClick={() => { navHome('/') }}>返回首页</Button>

           
        </div>
    )
}
